<!DOCTYPE html>
<html ng-app='changeApp'>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">	<title></title>
	<link rel="stylesheet" href="../teacherCss/reset.css">
	<link rel="stylesheet" href="../teacherCss/global.css">
	<link rel="stylesheet" type="text/css" href="../studentCss/changePassword.css">
</head>
<body ng-controller='changeController'>
	<h1>修改密码</h1>
	<div>
		<span>原密码：</span>
		<input type="text" ng-model='oldPwd' name="">
	</div>
	<div>
		<span>新密码：</span>
		<input type="text" ng-model='newPwd' name="">
	</div>
	<div>
		<span>确认新密码：</span>
		<input type="text" ng-model='aginPwd' name="">
	</div>
	<button type="button" class="save" ng-click='save()'>修改</button>
	<button type="button" class="cancel" ng-click='cancel()'>取消</button>
	<script src='../teacherJs/flexible.debug.js'></script>
	<script src='../../bower_components/jquery/dist/jquery.min.js'></script>
	<script src='../../bower_components/angular/angular.min.js'></script>
	<script>
		var app = angular.module('changeApp',[]);
		app.controller('changeController',['$scope','$http',function($scope,$http){
			$scope.cancel = function(){
				history.go(-1);
			}
			$scope.save = function(){
				if($scope.newPwd != alignPwd){
					alert('两次密码输入不一致！');
					return;
				}
				if($scope.oldPwd == null || $scope.newPwd == null || $scope.aginPwd == null){
					alert('密码不能为空');
				}
				else{
					alert('修改成功');
					// $.ajax({
					// 	url:'http://ourworkmanager.cn/myine/userinfo/userinfoupdate.php',
					// 	method:'post',
					// 	data:{
					// 		username:localStrolage.username,
					// 		newPasswoed:$scope.newPwd,
					// 		oldPassword:$scope.oldPwd
					// 	},
					// 	success:function(res){
					// 		alert(res.data);
					// 	}
					// })
					location.href = '../code/login.html';
				}
			}

		}])
	</script>
</body>
</html>